package com.example.demo2.test.pong;

import lombok.extern.slf4j.Slf4j;
import okhttp3.WebSocket;

@Slf4j
public class OkPong implements Runnable {

	private static WebSocket webSocket;
	@Override
	public  void run(){
		while(true) {
			try {
				Thread.sleep(5000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			webSocket.send("ping");
		}
	}
	public OkPong(WebSocket webSocket){
		this.webSocket = webSocket;
	}
}